package com.yy.QSManage.api;

import com.yy.QSManage.common.Result;
import com.yy.QSManage.model.entity.FaSysFile;
import com.yy.QSManage.service.FaSysFileService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequestMapping("/FaSysFileApi")
@Api(tags = "文件")
public class FaSysFileApi extends BaseApi<FaSysFile>{

    @Autowired
    FaSysFileService fileService;

    @ApiOperation(value = "文件上传")
    @PostMapping("/upload")
    public Result<FaSysFile> fileUpload(@RequestParam("file") MultipartFile file){
        return Result.success(fileService.upload(file));
    }
}
